package com.ruihu.admin.common.exception;

import com.ruihu.admin.common.constant.ResponseCodeConst;

/**
 * 
 * [ 业务逻辑异常,全局异常拦截后统一返回ResponseCodeConst.SYSTEM_ERROR ]
 * 
 * @version 1.0
 * @since JDK1.8
 * @author yandanyang
 * @company Ruihu (Nanjing) Information Technology Co., Ltd
 * @copyright (c) 2019 Ruihu (Nanjing) Information Technology Co., LtdInc. All rights reserved.
 * @date
 */
public class BusinessException extends RuntimeException {

    private ResponseCodeConst responseCodeConst;

    public BusinessException() {
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public BusinessException(ResponseCodeConst responseCodeConst) {
        super();
        this.responseCodeConst = responseCodeConst;
    }

    public BusinessException(ResponseCodeConst responseCodeConst, Throwable cause) {
        super(responseCodeConst.getMsg(), cause);
        this.responseCodeConst = responseCodeConst;
    }

    public ResponseCodeConst getResponseCodeConst() {
        return this.responseCodeConst;
    }
}
